<%@page import="bbs.BBSVo"%>
<%@page import="bbs.BBS"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn"  uri="http://java.sun.com/jsp/jstl/functions"%>
<%request.setCharacterEncoding("utf-8"); %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
body {
	font-family: '나눔고딕';
	font-size: 14px;
	font-weight: bold;
	color: red;
	margin-top: 100px;
	background-image: url('../../images/main.jpg');
	background-size: 55% 57%;
	}
</style>
<script type="text/javascript">
	function goDel(pwd,num) {
		var pwd1 = prompt("비밀번호를 입력해주세요!", "");
		if(pwd == pwd1){
			location.href='${pageContext.request.contextPath }/homepage/bbs/BDelete.jsp?num='+num;
		}else{
			alert("비밀번호가 일치하지 않습니다!");
		}
	}
	function goEdit(pwd,num) {
		var pwd1 = prompt("비밀번호를 입력해주세요!", "");
		if(pwd == pwd1){
			location.href='${pageContext.request.contextPath }/homepage/bbs/BEdit.jsp?num='+num;
		}else{
			alert("비밀번호가 일치하지 않습니다!");
		}
	}
</script>
</head>
<body>
	<jsp:useBean id="bv" class="bbs.BBSVo" />
	<jsp:setProperty property="*" name="bv"/>
	<%
		BBS bbs = new BBS();
		bbs.setBv(bv);
		BBSVo vo = bbs.view();
	%>
	<c:set var="vo" value="<%=vo %>"></c:set>
	<div>작성자: ${vo.mid }</div>
	<div>제목: ${vo.title }</div>
	<div>작성일: ${fn:substring(vo.sedate,0,10) }</div>
	<div style="width: 700px; height: 500px; overflow: auto; border: 3px solid red;  background-color: white;">${vo.sbContent.toString() }</div>
	<input type="button" value="수정" onclick="goEdit('${vo.pwd}',${vo.num })">
	<input type="button" value="삭제" onclick="goDel('${vo.pwd}',${vo.num })">
	<input type="button" value="목록" onclick="location.href='${pageContext.request.contextPath }/homepage/bbs/BList.jsp'">
</body>
</html>